	<?php $this->load->view('admin/partials/general_menu'); ?>
	<?php 
		$ci= &get_instance();	
		$catArray = $ci->pre_define_entity->getListCategory();
		$sportDataArray = $ci->sport_entity->getArrayIdAndNameOfSport();	
	?>
	
	<div class="clrboth"></div>
	<h3>Default Events</h3>
	<?php $buttons = array('buttons'=>array('Add Category#add_category();', 'Add Event#add_event();') );?>
	<?php $this->load->view('admin/partials/buttons', $buttons ); ?>

	<div class="clrboth"></div>
	
	<table border="0" class="table-list">
		<thead>
			<tr>
				<th>Match Type</th>
				<th>Category</th>
				<th>Event</th>
				<th>Odds</th>
			 	<th><?php echo lang('dataman.manage'); ?></th>
			</tr>
		</thead>
		
		<tbody>
			<?php foreach( $catArray as $item ): ?>
				<tr>
					<td><?php if($item->sport_id) echo $sportDataArray[$item->sport_id]; ?></td>
					<td><?php echo $item->title; ?></td>
					<td>&nbsp;</td>
					<td>&nbsp;</td>
					<td>
						<a href="javascript:void(0);" onclick="javascript:edit_default_category(<?php echo $item->id;?>);" >Edit</a>
						|
						<a href="javascript:void(0);" onclick="javascript:delete_default_category(<?php echo $item->id;?>);" >Delete</a>
					</td>
				</tr>
				<?php 
					$event_array = $ci->pre_define_entity->getListEventOfCategory($item->id); 
				?>
				<?php foreach( $event_array as $ev ): ?>
				<tr>
					<td>&nbsp;</td>
					<td>&nbsp;</td>
					<td><?php echo $ev->title; ?></td>
					<td><?php echo $ev->odds;?></td>
					<td>
					&nbsp;&nbsp;&nbsp;&nbsp;
						<a href="javascript:void(0);" onclick="javascript:edit_default_event(<?php echo $ev->id;?>);" >Edit</a>
						|
						<a href="javascript:void(0);" onclick="javascript:delete_default_event(<?php echo $ev->id;?>);" >Delete</a>
					</td>
				</tr>
				<?php endforeach; ?>
			<?php endforeach; ?>
		</tbody>
	</table>


